package cn.jiadakeji.parent.service.impl;

import cn.jiadakeji.parent.domain.TermCourseStudent;
import cn.jiadakeji.parent.mapper.TermCourseStudentMapper;
import cn.jiadakeji.parent.service.TermCourseStudentService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author heyanfeng
 * @create 2022-03-10 11:44
 */
@Service
public class TermCourseStudentServiceImpl extends ServiceImpl<TermCourseStudentMapper, TermCourseStudent> implements TermCourseStudentService {


    @Override
    public List<TermCourseStudent> getTermCourse(String studentId) {
       return baseMapper.selectList(new QueryWrapper<TermCourseStudent>()
                .eq("student_id", studentId));
    }

    @Override
    public TermCourseStudent getStudent(String coursePreId) {
        return baseMapper.selectOne(new QueryWrapper<TermCourseStudent>().eq("term_course_id",coursePreId));
    }
}
